package Message;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;


public class PcrResultMessage implements Serializable{
	public String getTube_ID() {
		return tube_ID;
	}
	public void setTube_ID(String tube_ID) {
		this.tube_ID = tube_ID;
	}
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
	public String getResultTime() {
		return resultTime;
	}
	public void setResultTime(String resultTime) {
		this.resultTime = resultTime;
	}
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public String tube_ID;
	public String result;
	public String resultTime;
	  //序列化
	  public static String serializeToString(PcrResultMessage obj) throws Exception{
	    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();  
	        ObjectOutputStream objOut = new ObjectOutputStream(byteOut);  
	        objOut.writeObject(obj);  
	        String str = byteOut.toString("ISO-8859-1");//此处只能是ISO-8859-1,但是不会影响中文使用
	        return str;
	  }
	  //反序列化
	  public static PcrResultMessage deserializeToObject(String str) throws Exception{
	     ByteArrayInputStream byteIn = new ByteArrayInputStream(str.getBytes("ISO-8859-1"));  
	       ObjectInputStream objIn = new ObjectInputStream(byteIn);  
	       Object obj =objIn.readObject();  
	       return (PcrResultMessage)obj;  
	  }
}
